<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>期货交易所</title>
    <style>
        .pr {
            position: relative;
        }

        .pa {
            position: absolute;
        }

        h1, h2, h3, h4, h5, h6 {
            font-size: 100%;
            font-weight: normal;
        }

        .list {
            width: 99.8%;
            height: 240px;
            border: solid 1px #CCC;
            float: left;
            overflow: hidden;
        }

        .tab {
            width: 100%;
            height: 217px;
            float: left;
            overflow: hidden;
        }

        .table1 {
            width: 100%;
            height: 35px;
        }

        .table1 a {
            text-decoration: none;
            color: #06F;
        }

        .table1 th {
            color: #484848;
            border-bottom: 1px solid #CCCCCC;
            font: 14px/35px "微软雅黑";
            color: #777777;
            text-align: center;
        }

        .tab_con {
        }

        .tab_con tr {
        }

        .tab_con tr td {
            border-bottom: 1px solid #E2E2E2;
            font: 12px/30px "微软雅黑";
            color: #777777;
            text-align: center;
        }

        .tab_con .redtd {
            border-bottom: 1px solid #E2E2E2;
            font: 12px/30px "微软雅黑";
            color: #FF0000;
            text-align: center;
        }

        .tab_con .greentd {
            border-bottom: 1px solid #E2E2E2;
            font: 12px/30px "微软雅黑";
            color: #228B22;
            text-align: center;
        }

        .top-tea {
        }

        .top-tea > div {
            display: inline-block;
        }

        .top-tea .right-s {
            vertical-align: top;
        }

        .top-tea .navItems {
            overflow: hidden;
            height: 84px;
        }

        .top-tea .navItems a {
            color: #333;
            text-decoration: none;
            display: inline-block;
            border-right: 1px solid #008707;
            padding: 2px 12px 2px 8px;
            margin-bottom: 8px;
            font-size: 14px;
        }

        .top-tea .navItems a:last-child {
            border-right: 0;
        }

        .top-tea .navItems a:hover, .top-tea .navItems a:focus, .top-tea .navItems a.active {
            color: #008707;
        }

        .top-tea .right-s {
            cursor: pointer;
        }

        body {
            margin: 0;
        }
    </style>
    <script src="\static\home/js/jquery.min.js"></script>
</head>
<body>
<div class="top-tea" id="top-tea-one"></div>
<div class="list" id="index_list">
    <table cellspacing="0" cellpadding="0" class="table1">
        <tbody>
        <tr class="tabHead">
            <!-- <th>商品编号</th> -->
            <th>商品名称</th>
            <th>昨结算</th>
            <th>开盘价</th>
            <th>最新价</th>
            <th>最高价</th>
            <th>最低价</th>
            <th>结算价</th>
            <th>成交量</th>
            <th>持仓量</th>
            <th>卖&nbsp;&nbsp;量</th>
        </tr>
        </tbody>
    </table>
    <div id="demo" class="tab">
        <div id="demo1" class="table-responsive">
            <table width="100%" cellpadding="0" cellspacing="0" class="tab_con " id="tab_con_one">

            </table>
        </div>
        <div id="demo2" class="table-responsive">
            <table width="100%" cellpadding="0" cellspacing="0" class="tab_con table-responsive" id="tab_con_two">

            </table>
        </div>
    </div>
</div>
<!--<script type="text/javascript"-->
<!--src="http://hq.sinajs.cn/list=RB1805,I1805,M1809,RM1805,Y1805,JD1805,JM1805,J1805,AG1806,AU1806,CU0,HC0,SC0"-->
<!--charset="UTF-8"></script>-->

<script type="text/javascript"
        src="http://hq.sinajs.cn/list=SC1809,CU1810,RB1810,HC1810,AU1812,AG1812,I1809,JM1809,J1809,NI1809,RU1809,M1809,AP1810,SR1809,CF1809,TC1809,MA1809"
        charset="UTF-8"></script>


<script type="text/javascript">

    var elements = hq_str_SC1809.split(",");
    var elements1 = hq_str_CU1810.split(",");
    var elements2 = hq_str_RB1810.split(",");
    var elements3 = hq_str_HC1810.split(",");
    var elements4 = hq_str_AU1812.split(",");
    var elements5 = hq_str_AG1812.split(",");
    var elements6 = hq_str_I1809.split(",");
    var elements7 = hq_str_JM1809.split(",");
    var elements8 = hq_str_J1809.split(",");
    var elements9 = hq_str_NI1809.split(",");
    var elements10 = hq_str_RU1809.split(",");
    var elements11 = hq_str_M1809.split(",");
    var elements12 = hq_str_AP1810.split(",");
    var elements13 = hq_str_SR1809.split(",");
    var elements14 = hq_str_CF1809.split(",");
    var elements15 = hq_str_TC1809.split(",");
    var elements16 = hq_str_MA1809.split(",");
    var elements17 = hq_str_ZC1809.split(",");


    if (elements[0] != "" && elements[0] != null) {
        var dataHtml = '<tr>' +
            '<td class = greentd>' + elements[0] + '</td>' +
            '<td class = greentd>' + elements[10] + '</td>' +
            '<td class = greentd>' + elements[2] + '</td>' +
            '<td class = greentd>' + elements[8] + '</td>' +
            '<td class = greentd>' + elements[3] + '</td>' +
            '<td class = greentd>' + elements[4] + '</td>' +
            '<td class = greentd>' + elements[9] + '</td>' +
            '<td class = greentd>' + elements[14] + '</td>' +
            '<td class = greentd>' + elements[13] + '</td>' +
            '<td class = greentd>' + elements[12] + '</td>' +
            '</tr>';
    }
    if (elements1[0] != "" && elements1[0] != null) {
        dataHtml += '<tr>' +
            '<td class = redtd>' + elements1[0] + '</td>' +
            '<td class = redtd>' + elements1[10] + '</td>' +
            '<td class = redtd>' + elements1[2] + '</td>' +
            '<td class = redtd>' + elements1[8] + '</td>' +
            '<td class = redtd>' + elements1[3] + '</td>' +
            '<td class = redtd>' + elements1[4] + '</td>' +
            '<td class = redtd>' + elements1[9] + '</td>' +
            '<td class = redtd>' + elements1[14] + '</td>' +
            '<td class = redtd>' + elements1[13] + '</td>' +
            '<td class = redtd>' + elements1[12] + '</td>' +
            '</tr>';
    }
    if (elements2[0] != "" && elements2[0] != null) {
        dataHtml += '<tr>' +
            '<td class = greentd>' + elements2[0] + '</td>' +
            '<td class = greentd>' + elements2[10] + '</td>' +
            '<td class = greentd>' + elements2[2] + '</td>' +
            '<td class = greentd>' + elements2[8] + '</td>' +
            '<td class = greentd>' + elements2[3] + '</td>' +
            '<td class = greentd>' + elements2[4] + '</td>' +
            '<td class = greentd>' + elements2[9] + '</td>' +
            '<td class = greentd>' + elements2[14] + '</td>' +
            '<td class = greentd>' + elements2[13] + '</td>' +
            '<td class = greentd>' + elements2[12] + '</td>' +
            '</tr>';
    }
    if (elements3[0] != "" && elements3[0] != null) {
        dataHtml += '<tr>' +
            '<td class = redtd>' + elements3[0] + '</td>' +
            '<td class = redtd>' + elements3[10] + '</td>' +
            '<td class = redtd>' + elements3[2] + '</td>' +
            '<td class = redtd>' + elements3[8] + '</td>' +
            '<td class = redtd>' + elements3[3] + '</td>' +
            '<td class = redtd>' + elements3[4] + '</td>' +
            '<td class = redtd>' + elements3[9] + '</td>' +
            '<td class = redtd>' + elements3[14] + '</td>' +
            '<td class = redtd>' + elements3[13] + '</td>' +
            '<td class = redtd>' + elements3[12] + '</td>' +
            '</tr>';
    }
    if (elements4[0] != "" && elements4[0] != null) {
        dataHtml += '<tr>' +
            '<td class = greentd>' + elements4[0] + '</td>' +
            '<td class = greentd>' + elements4[10] + '</td>' +
            '<td class = greentd>' + elements4[2] + '</td>' +
            '<td class = greentd>' + elements4[8] + '</td>' +
            '<td class = greentd>' + elements4[3] + '</td>' +
            '<td class = greentd>' + elements4[4] + '</td>' +
            '<td class = greentd>' + elements4[9] + '</td>' +
            '<td class = greentd>' + elements4[14] + '</td>' +
            '<td class = greentd>' + elements4[13] + '</td>' +
            '<td class = greentd>' + elements4[12] + '</td>' +
            '</tr>';
    }
    if (elements5[0] != "" && elements5[0] != null) {
        dataHtml += '<tr>' +
            '<td class = redtd>' + elements5[0] + '</td>' +
            '<td class = redtd>' + elements5[10] + '</td>' +
            '<td class = redtd>' + elements5[2] + '</td>' +
            '<td class = redtd>' + elements5[8] + '</td>' +
            '<td class = redtd>' + elements5[3] + '</td>' +
            '<td class = redtd>' + elements5[4] + '</td>' +
            '<td class = redtd>' + elements5[9] + '</td>' +
            '<td class = redtd>' + elements5[14] + '</td>' +
            '<td class = redtd>' + elements5[13] + '</td>' +
            '<td class = redtd>' + elements5[12] + '</td>' +
            '</tr>';
    }
    if (elements6[0] != "" && elements6[0] != null) {
        dataHtml += '<tr>' +
            '<td class = greentd>' + elements6[0] + '</td>' +
            '<td class = greentd>' + elements6[10] + '</td>' +
            '<td class = greentd>' + elements6[2] + '</td>' +
            '<td class = greentd>' + elements6[8] + '</td>' +
            '<td class = greentd>' + elements6[3] + '</td>' +
            '<td class = greentd>' + elements6[4] + '</td>' +
            '<td class = greentd>' + elements6[9] + '</td>' +
            '<td class = greentd>' + elements6[14] + '</td>' +
            '<td class = greentd>' + elements6[13] + '</td>' +
            '<td class = greentd>' + elements6[12] + '</td>' +
            '</tr>';
    }
    if (elements7[0] != "" && elements7[0] != null) {
        dataHtml += '<tr>' +
            '<td class = redtd>' + elements7[0] + '</td>' +
            '<td class = redtd>' + elements7[10] + '</td>' +
            '<td class = redtd>' + elements7[2] + '</td>' +
            '<td class = redtd>' + elements7[8] + '</td>' +
            '<td class = redtd>' + elements7[3] + '</td>' +
            '<td class = redtd>' + elements7[4] + '</td>' +
            '<td class = redtd>' + elements7[9] + '</td>' +
            '<td class = redtd>' + elements7[14] + '</td>' +
            '<td class = redtd>' + elements7[13] + '</td>' +
            '<td class = redtd>' + elements7[12] + '</td>' +
            '</tr>';
    }
    if (elements8[0] != "" && elements8[0] != null) {
        dataHtml += '<tr>' +
            '<td class = greentd>' + elements8[0] + '</td>' +
            '<td class = greentd>' + elements8[10] + '</td>' +
            '<td class = greentd>' + elements8[2] + '</td>' +
            '<td class = greentd>' + elements8[8] + '</td>' +
            '<td class = greentd>' + elements8[3] + '</td>' +
            '<td class = greentd>' + elements8[4] + '</td>' +
            '<td class = greentd>' + elements8[9] + '</td>' +
            '<td class = greentd>' + elements8[14] + '</td>' +
            '<td class = greentd>' + elements8[13] + '</td>' +
            '<td class = greentd>' + elements8[12] + '</td>' +
            '</tr>';
    }
    if (elements9[0] != "" && elements9[0] != null) {
        dataHtml += '<tr>' +
            '<td class = redtd>' + elements9[0] + '</td>' +
            '<td class = redtd>' + elements9[10] + '</td>' +
            '<td class = redtd>' + elements9[2] + '</td>' +
            '<td class = redtd>' + elements9[8] + '</td>' +
            '<td class = redtd>' + elements9[3] + '</td>' +
            '<td class = redtd>' + elements9[4] + '</td>' +
            '<td class = redtd>' + elements9[9] + '</td>' +
            '<td class = redtd>' + elements9[14] + '</td>' +
            '<td class = redtd>' + elements9[13] + '</td>' +
            '<td class = redtd>' + elements9[12] + '</td>' +
            '</tr>';
    }
    if (elements10[0] != "" && elements10[0] != null) {
        dataHtml += '<tr>' +
            '<td class = greentd>' + elements10[0] + '</td>' +
            '<td class = greentd>' + elements10[10] + '</td>' +
            '<td class = greentd>' + elements10[2] + '</td>' +
            '<td class = greentd>' + elements10[8] + '</td>' +
            '<td class = greentd>' + elements10[3] + '</td>' +
            '<td class = greentd>' + elements10[4] + '</td>' +
            '<td class = greentd>' + elements10[9] + '</td>' +
            '<td class = greentd>' + elements10[14] + '</td>' +
            '<td class = greentd>' + elements10[13] + '</td>' +
            '<td class = greentd>' + elements10[12] + '</td>' +
            '</tr>';
    }
    if (elements11[0] != "" && elements11[0] != null) {
        dataHtml += '<tr>' +
            '<td class = redtd>' + elements11[0] + '</td>' +
            '<td class = redtd>' + elements11[10] + '</td>' +
            '<td class = redtd>' + elements11[2] + '</td>' +
            '<td class = redtd>' + elements11[8] + '</td>' +
            '<td class = redtd>' + elements11[3] + '</td>' +
            '<td class = redtd>' + elements11[4] + '</td>' +
            '<td class = redtd>' + elements11[9] + '</td>' +
            '<td class = redtd>' + elements11[14] + '</td>' +
            '<td class = redtd>' + elements11[13] + '</td>' +
            '<td class = redtd>' + elements11[12] + '</td>' +
            '</tr>';
    }
    if (elements12[0] != "" && elements12[0] != null) {
        dataHtml += '<tr>' +
            '<td class = greentd>' + elements12[0] + '</td>' +
            '<td class = greentd>' + elements12[10] + '</td>' +
            '<td class = greentd>' + elements12[2] + '</td>' +
            '<td class = greentd>' + elements12[8] + '</td>' +
            '<td class = greentd>' + elements12[3] + '</td>' +
            '<td class = greentd>' + elements12[4] + '</td>' +
            '<td class = greentd>' + elements12[9] + '</td>' +
            '<td class = greentd>' + elements12[14] + '</td>' +
            '<td class = greentd>' + elements12[13] + '</td>' +
            '<td class = greentd>' + elements12[12] + '</td>' +
            '</tr>';
    }

    if (elements13[0] != "" && elements13[0] != null) {
        dataHtml += '<tr>' +
            '<td class = redtd>' + elements13[0] + '</td>' +
            '<td class = redtd>' + elements13[10] + '</td>' +
            '<td class = redtd>' + elements13[2] + '</td>' +
            '<td class = redtd>' + elements13[8] + '</td>' +
            '<td class = redtd>' + elements13[3] + '</td>' +
            '<td class = redtd>' + elements13[4] + '</td>' +
            '<td class = redtd>' + elements13[9] + '</td>' +
            '<td class = redtd>' + elements13[14] + '</td>' +
            '<td class = redtd>' + elements13[13] + '</td>' +
            '<td class = redtd>' + elements13[12] + '</td>' +
            '</tr>';
    }
    if (elements14[0] != "" && elements14[0] != null) {
        dataHtml += '<tr>' +
            '<td class = greentd>' + elements14[0] + '</td>' +
            '<td class = greentd>' + elements14[10] + '</td>' +
            '<td class = greentd>' + elements14[2] + '</td>' +
            '<td class = greentd>' + elements14[8] + '</td>' +
            '<td class = greentd>' + elements14[3] + '</td>' +
            '<td class = greentd>' + elements14[4] + '</td>' +
            '<td class = greentd>' + elements14[9] + '</td>' +
            '<td class = greentd>' + elements14[14] + '</td>' +
            '<td class = greentd>' + elements14[13] + '</td>' +
            '<td class = greentd>' + elements14[12] + '</td>' +
            '</tr>';
    }
    if (elements15[0] != "" && elements15[0] != null) {
        dataHtml += '<tr>' +
            '<td class = redtd>' + elements15[0] + '</td>' +
            '<td class = redtd>' + elements15[10] + '</td>' +
            '<td class = redtd>' + elements15[2] + '</td>' +
            '<td class = redtd>' + elements15[8] + '</td>' +
            '<td class = redtd>' + elements15[3] + '</td>' +
            '<td class = redtd>' + elements15[4] + '</td>' +
            '<td class = redtd>' + elements15[9] + '</td>' +
            '<td class = redtd>' + elements15[14] + '</td>' +
            '<td class = redtd>' + elements15[13] + '</td>' +
            '<td class = redtd>' + elements15[12] + '</td>' +
            '</tr>';
    }
    if (elements16[0] != "" && elements16[0] != null) {
        dataHtml += '<tr>' +
            '<td class = greentd>' + elements16[0] + '</td>' +
            '<td class = greentd>' + elements16[10] + '</td>' +
            '<td class = greentd>' + elements16[2] + '</td>' +
            '<td class = greentd>' + elements16[8] + '</td>' +
            '<td class = greentd>' + elements16[3] + '</td>' +
            '<td class = greentd>' + elements16[4] + '</td>' +
            '<td class = greentd>' + elements16[9] + '</td>' +
            '<td class = greentd>' + elements16[14] + '</td>' +
            '<td class = greentd>' + elements16[13] + '</td>' +
            '<td class = greentd>' + elements16[12] + '</td>' +
            '</tr>';
    }
    if (elements17[0] != "" && elements17[0] != null) {
        dataHtml += '<tr>' +
            '<td class = greentd>' + elements17[0] + '</td>' +
            '<td class = greentd>' + elements17[10] + '</td>' +
            '<td class = greentd>' + elements17[2] + '</td>' +
            '<td class = greentd>' + elements17[8] + '</td>' +
            '<td class = greentd>' + elements17[3] + '</td>' +
            '<td class = greentd>' + elements17[4] + '</td>' +
            '<td class = greentd>' + elements17[9] + '</td>' +
            '<td class = greentd>' + elements17[14] + '</td>' +
            '<td class = greentd>' + elements17[13] + '</td>' +
            '<td class = greentd>' + elements17[12] + '</td>' +
            '</tr>';
    }



    $('#tab_con_one').html(dataHtml);

</script>
<script>


    function bindSecClick() {
        /**二级菜单事件绑定*/
        $('#top-tea-one .navItems a').on('click', function () {
            //$("#xhgp-sec-place a").attr("class","");
            if ($(this).hasClass('active')) {
                return false;
            }
            $(this).addClass('active');
            $(this).siblings().removeClass('active');
            var myURL = "/getTeaMarketData.action?firstLevelCate=1&secondLevelCate=" + $(this).attr('sec-level-data');
            $.ajax({
                cache: false,
                url: myURL,
                dataType: "json",
                type: "GET",
                success: function (data) {
                    $('.tab_con').html("");
                    var dataHtml = "";
                    for (var i = 0; i < data.root.length; i++) {
                        var colorpara = data.root[i].riseFallFlage;
                        var classz = 'redtd';
                        if (colorpara == 2) {
                            classz = 'greentd';
                        }
                        dataHtml += '<tr>' +
                            /* '<td class = '+classz+'>'+ data.root[i].WAREID +'</td>' + */
                            '<td class = ' + classz + '>' + data.root[i].WARENAME + '</td>' +
                            '<td class = ' + classz + '>' + data.root[i].YESAVGPRICE + '</td>' +
                            '<td class = ' + classz + '>' + data.root[i].OPENPRICE + '</td>' +
                            '<td class = ' + classz + '>' + data.root[i].NEWPRICE + '</td>' +
                            '<td class = ' + classz + '>' + data.root[i].HIGHPRICE + '</td>' +
                            '<td class = ' + classz + '>' + data.root[i].LOWERPRICE + '</td>' +
                            '<td class = ' + classz + '>' + data.root[i].AVGPRICE + '</td>' +
                            '<td class = ' + classz + '>' + data.root[i].CONTNUM + '</td>' +
                            '<td class = ' + classz + '>' + data.root[i].HOLDNUM + '</td>' +
                            '<td class = ' + classz + '>' + data.root[i].deliveryPlace + '</td>' +
                            '</tr>';
                    }
                    $('#tab_con_one').html(dataHtml);

                    setTimeout("countSecond()", 1000);

                }
            });
        });
    }

    var MyMarh;

    function countSecond() {
        clearInterval(MyMarh);  //点击二级菜单后清除原始速度
        if ($('#tab_con_one tr').length > 5) {
            var scrollnum = 68;
        }
        var speed = 80;
        MyMarh = setInterval(Marqueeh, speed);
        if (scrollnum > 7) {
            demo2.innerHTML = demo1.innerHTML;
            //原理是不断的向demoh2中填入demoh1中的内容，然后将已经看不见的清除
            //用一个两行一列的表格，上一列再放一个装填有内容的表格，定义为demoh1，下一列是空的TD，定义为demoh2
            //SPEED是用来控制速度的。
            demo.onmouseover = function () {
                clearInterval(MyMarh);
            }
            demo.onmouseout = function () {
                MyMarh = setInterval(Marqueeh, speed);
            }
        }
    }

    function Marqueeh() {
        if (demo2.offsetHeight - demo.scrollTop <= 0)
            demo.scrollTop -= demo1.offsetHeight
        else {
            demo.scrollTop++
        }
    }

    setTimeout("countSecond()", 1000);


    $("#tab_con_one").find("tr").each(function () {
        var widTab = $("#tab_con_one").width();
        $(this).find("td").width(widTab / 10);
    });
    var tabHead = $(".tabHead").width();
    $(".tabHead").find("th").width(tabHead / 10);

</script>
</body>
</html>